﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="ToggleStyle" TargetType="{x:Type ToggleButton}">
        <Style.Triggers>
            <Trigger Property="IsChecked" Value="True">
                <Setter Property="Background"  Value="#FFC4E5F6"/>
                <Setter Property="BorderBrush"  Value="#FF2C628B"/>
                
            </Trigger>
            


        </Style.Triggers>
    </Style>

    <Style x:Key="AnonymousButtonStyle" BasedOn="{StaticResource ToggleStyle}" TargetType="{x:Type ToggleButton}">
        <Style.Triggers>


            <DataTrigger Binding="{Binding  NicoCommentEditorViewModel.Connected, Mode=OneWay, Source={StaticResource locator}}" Value="true">
                <Setter Property="Visibility" Value="Visible"/>
            </DataTrigger>

            <DataTrigger Binding="{Binding  NicoCommentEditorViewModel.Connected, Mode=OneWay, Source={StaticResource locator}}" Value="false">
                <Setter Property="Visibility" Value="Collapsed"/>
            </DataTrigger>

        </Style.Triggers>
    </Style>

    <Style x:Key="OwnerButtonStyle" BasedOn="{StaticResource ToggleStyle}" TargetType="{x:Type ToggleButton}">
        <Style.Triggers>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>

                    <Condition  Value="true" Binding="{Binding NicoCommentEditorViewModel.Connected, Mode=OneWay, Source={StaticResource locator}}" />
                    <Condition Value="true" Binding="{Binding NicoCommentEditorViewModel.IsOwner, Mode=OneWay, Source={StaticResource locator}}"/>
                </MultiDataTrigger.Conditions>

                <Setter Property="Visibility" Value="Visible"/>
            </MultiDataTrigger>


            <DataTrigger Binding="{Binding  NicoCommentEditorViewModel.Connected, Mode=OneWay, Source={StaticResource locator}}" Value="false">
                <Setter Property="Visibility" Value="Collapsed"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding  NicoCommentEditorViewModel.IsOwner, Mode=OneWay, Source={StaticResource locator}}" Value="false">
                <Setter Property="Visibility" Value="Collapsed"/>
            </DataTrigger>


        </Style.Triggers>
    </Style>
    <Style x:Key="CommentEditTextStyle" TargetType="{x:Type TextBox}">
        <Style.Triggers>


            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>

                    <Condition  Value="Visible" Binding="{Binding Visibility, ElementName=AnonymousButton}" />
                    <Condition Value="True" Binding="{Binding IsChecked, ElementName=AnonymousButton}"/>
                </MultiDataTrigger.Conditions>

                <Setter Property="Background" Value="#E2E2E2"/>
            </MultiDataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition  Value="Visible" Binding="{Binding Visibility, ElementName=OwnerButton}" />
                    <Condition Value="True" Binding="{Binding IsChecked, ElementName=OwnerButton}"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Background" Value="LightPink"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="CommandListItemStyle"
       TargetType="ListBoxItem">
        <Setter Property="SnapsToDevicePixels"
          Value="true" />
        <Setter Property="OverridesDefaultStyle"
          Value="true" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Border x:Name="Border"
                Padding="2"
                SnapsToDevicePixels="true">
                        <Border.Background>
                            <SolidColorBrush Color="Transparent" />
                        </Border.Background>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                Storyboard.TargetProperty="(Panel.Background).
                    (SolidColorBrush.Color)">
                                            <EasingColorKeyFrame KeyTime="0"
                                         Value="SkyBlue" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SelectedUnfocused">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                Storyboard.TargetProperty="(Panel.Background).
                    (SolidColorBrush.Color)">
                                            <EasingColorKeyFrame KeyTime="0"
                                         Value="SkyBlue" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>